package com.ymm.platform.dao.rpc.impl;

import com.ymm.driver.api.constants.Entity.DriverEntity;
import com.ymm.driver.api.facade.DriverPersonalAllInformationService;
import com.ymm.driver.api.utils.Result;
import com.ymm.platform.dao.rpc.DriverRPC;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

import java.math.BigInteger;

/**
 * @Description: driver相关的rpc服务调用接口实现
 * @Author: Xuecheng Li
 * @CreateTime: 2022-08-13 20:35
 * @Version: 1.0.0
 */
@Component
public class DriverRPCImpl implements DriverRPC {

    /**
     * 远程rpc服务，dubbo实现
     */
    @Reference(version = "server")
    DriverPersonalAllInformationService driverInformationService;

    @Override
    public DriverEntity getDriverInfoById(Long driverId) {
        BigInteger input = BigInteger.valueOf(driverId);
        DriverEntity driverEntity = driverInformationService.driverSearchInfo(input).getData();

        return driverEntity;
    }
}
